using Orchard.UI.Resources;

namespace NGM.Portlets {
    public class ResourceManifest : IResourceManifestProvider {
        public void BuildManifests(ResourceManifestBuilder builder) {
            var manifest = builder.Add();

            manifest.DefineScript("FluidDocument").SetUrl("framework/core/js/FluidDocument.js");
            manifest.DefineScript("FluidKeyboardAllyDocument").SetUrl("framework/core/js/jquery.keyboard-a11y.js");
            manifest.DefineScript("Fluid").SetUrl("framework/core/js/Fluid.js");
            manifest.DefineScript("FluidIoC").SetUrl("framework/core/js/FluidIoC.js");
            manifest.DefineScript("FluidView").SetUrl("framework/core/js/FluidView.js");
            manifest.DefineScript("FluidDataBinding").SetUrl("framework/core/js/DataBinding.js");
            manifest.DefineScript("FluidDOMUtilities").SetUrl("framework/core/js/FluidDOMUtilities.js");

            manifest.DefineScript("FluidFramework").SetDependencies(
                "FluidDocument",
                "FluidKeyboardAllyDocument",
                "Fluid",
                "FluidView",
                "FluidIoC",
                "FluidDataBinding",
                "FluidDOMUtilities");

            manifest.DefineScript("FluidComponent_json2").SetUrl("lib/json/js/json2.js").SetVersion("2.0");

            manifest.DefineScript("FluidComponent_ReordererDOMUtilities").SetUrl("components/reorderer/js/ReordererDOMUtilities.js");
            manifest.DefineScript("FluidComponent_GeometricManager").SetUrl("components/reorderer/js/GeometricManager.js").SetDependencies("FluidComponent_ReordererDOMUtilities");
            manifest.DefineScript("FluidComponent_Reorderer").SetUrl("components/reorderer/js/Reorderer.js").SetDependencies("FluidComponent_GeometricManager");
            manifest.DefineScript("FluidComponent_LayoutReorderer").SetUrl("components/reorderer/js/LayoutReorderer.js").SetDependencies("FluidComponent_Reorderer");
            manifest.DefineScript("FluidComponent_ModuleLayout").SetUrl("components/reorderer/js/ModuleLayout.js").SetDependencies("FluidComponent_LayoutReorderer");
            

            manifest.DefineScript("FluidDependencies").SetDependencies("FluidFramework",
                "FluidComponent_json2",
                "FluidComponent_ModuleLayout");

            manifest.DefineScript("OrchardPortlets").SetUrl("orchard-portlets.js").SetDependencies(
                "jQuery",
                "jQueryUI_Core",
                "jQueryUI_Widget",
                "jQueryUI_Mouse",
                "jQueryUI_Draggable",
                "FluidDependencies");

            manifest.DefineScript("OrchardToolbelt").SetUrl("orchard-toolbelt.js").SetDependencies("jQuery");

            manifest.DefineScript("NyroModal").SetUrl("jquery.nyroModal/jquery.nyroModal.custom.min.js").SetDependencies("jQuery");
            manifest.DefineStyle("NyroModal").SetUrl("jquery.nyroModal/nyroModal.css");

            manifest.DefineScript("OrchardZoneManagement").SetUrl("orchard-zonemanagement.js").SetDependencies("jQuery", "NyroModal");

            manifest.DefineStyle("Reorderer").SetUrl("components/reorderer/css/Reorderer.css");
            manifest.DefineStyle("OrchardPortlets").SetUrl("orchard-portlets.css").SetDependencies("Reorderer");
            manifest.DefineStyle("OrchardToolbelt").SetUrl("orchard-toolbelt.css");
            manifest.DefineStyle("OrchardZoneManagement").SetUrl("orchard-zonemanagement.css");
        }
    }
}